package com.woniuxy.credit_loans.product_liu.controller;

import com.woniuxy.credit_loans.entity.ProductType;
import com.woniuxy.credit_loans.product_liu.service.ProductTypeService;
import com.woniuxy.credit_loans.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "产品类型表中的相关接口")
@RestController
@RequestMapping("/productTypes")
public class ProductTypeController {
    @Autowired
    private ProductTypeService productTypeService;

    @ApiOperation(value = "查询产品类型名称")
    @GetMapping("")
    public Result selectAllType(){
        List<ProductType> productTypes = productTypeService.selectAllType();
        return Result.ok().data("productType",productTypes);
    }
}
